package com.lgywin.runserver.service;

import com.lgywin.runserver.dao.GameServerMapper;
import com.lgywin.runserver.entity.GameServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class GameServerService {

    @Resource
    private GameServerMapper gameServerDao;

    public void insert(GameServer gameServer){
        gameServerDao.insert(gameServer);
    }

    public void update(GameServer gameServer){
        gameServerDao.update(gameServer);
    }

    public GameServer find(String ip, int port) {
        GameServer condition = new GameServer();
        condition.setIp(ip);
        condition.setPort(port);
        return gameServerDao.find(condition);
    }
}
